﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Attacks.aspx.cs" Inherits="TeamPrasioliteWarGame.Attacks"
EnableEventValidation="false" %>

<asp:Content ID="UserUnits" ContentPlaceHolderID="MainContent" runat="server">

    <asp:ListView runat="server" ID="ListViewUnits" ItemType="TeamPrasioliteWarGame.Models.UserUnit">
        <ItemTemplate>
            <li>
                <asp:Label Text="<%#: Item.GameUnit.Type %>" runat="server" />
                <asp:TextBox ID="daIma" runat="server" Text="0" />
                <asp:Literal ID="maxCount" Text="" runat="server" />

                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="The field is required" ControlToValidate="daIma" runat="server" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ErrorMessage="You must enter a number" ValidationExpression="[0-9]+" ControlToValidate="daIma" runat="server" />
                
            </li>
        </ItemTemplate>
        <LayoutTemplate>
            <ul>
                <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
            </ul>
        </LayoutTemplate>
        <EmptyDataTemplate>
            <div>You can't attack. You must recruit units first !</div>
        </EmptyDataTemplate>
    </asp:ListView>

    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <asp:ListView runat="server" ID="ListViewUsers" ItemType="TeamPrasioliteWarGame.Models.AspNetUser">
                <ItemTemplate>
                    <li>
                        <asp:LinkButton Text="<%#: Item.UserName %>" CommandArgument="<%#: Item.UserName %>"
                            OnCommand="ButtonSelectUser_Command"
                            runat="server" ID="ButtonSelectUser" />
                    </li>
                </ItemTemplate>
                <LayoutTemplate>
                    <ul>
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
                    </ul>
                    <asp:DataPager runat="server" ID="DataPagerUsers" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ShowNextPageButton="false" ShowPreviousPageButton="true" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ShowNextPageButton="true" ShowPreviousPageButton="false" />
                        </Fields>
                    </asp:DataPager>
                    </asp>
                </LayoutTemplate>
            </asp:ListView>

            <asp:Literal ID="Literal2" Text="User to attack - " runat="server" />
            <asp:Literal Text="" ID="UserToAttack" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:Button ID="Button1" CssClass="btn btn-warning" Text="Attack" runat="server" OnClick="ButtonAttack_Clicked" />
</asp:Content>
